import { defineStore } from 'pinia'

export const userPiniaStore = defineStore('userPiniaStore', {
    
    state: () => ({
        user: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {},
    }),
    actions: {
        setUser(data) {
            localStorage.setItem('user', JSON.stringify(data))
            this.user = data
        }
    }
})